#ifndef DRAGPUSHBUTTON_H
#define DRAGPUSHBUTTON_H

#include <QDebug>
#include <QMouseEvent>
#include <QPushButton>
#include <QWidget>

class DragPushButton : public QPushButton {
    Q_OBJECT
public:
    explicit DragPushButton(QWidget* parent = nullptr);
    void setIJ(int i, int j);
signals:
    void swapBlockSig(int i0, int j0, int i1, int j1);

protected:
    void mouseReleaseEvent(QMouseEvent* event);
    void mousePressEvent(QMouseEvent* event);
    void mouseMoveEvent(QMouseEvent* event);

private:
    static QPoint pressPoint;
    static int i0;
    static int j0;
    int i;
    int j;
};

#endif // DRAGPUSHBUTTON_H
